Fix play-start jank and import hangs for material-heavy scenes#42
Merged
Conversation
Engine-side fixes surfaced by the TinySkies playground port — a material-heavy procedural globe game that exposed startup stalls, in-flight jank, and an import-time hang. None are game-specific; they benefit any large OSS scene. - featureFlags: enable shared `@import` scripts in OSS unconditionally. REACT_APP_SCRIPTS_ENABLED is unset everywhere, so every behavior that `@import`s a helper failed to import. Scripts are a first-class OSS authoring feature; integrated keeps the env opt-in. - Editor / RenderEvent / RenderingQualityModule: make the scene's serialized `useShadows` the source of truth and seed the renderer's shadow tracking from it. A no-shadow scene was paying shadow-variant shader compiles + a full-scene shadow pass every frame, and the first post-(re)create frame spuriously marked every material needsUpdate. Adaptive quality may still downgrade shadows but never force them on. - EngineRuntime: precompile material pipelines with compileAsync before the loop starts, and hold the loading overlay until the first frame renders — folding one-time shader compiles into play-start load instead of streaming jank in mid-play. Both best-effort/bounded. - GameManager: init behaviors in small batches that yield to paint, so the loading overlay advances instead of the UI freezing during a large world build. - BehaviorManager: drop the per-behavior fixedUpdate "not implemented" warning — dozens of warn-with-stacktrace calls stalled play start for no benefit; not implementing an optional hook is normal. - Editor.runScriptImport: pause the editor render loop during a bulk script import so per-command cost stays flat (was ~O(n^2), a multi-minute hang that could OOM the renderer). - remote-go thumbnail: guard the `/api/Scene/Edit` POST behind !IS_OSS; OSS has no such endpoint, so it 404-spammed on every import. Adds the port planning doc under docs/planning/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Engine-side fixes surfaced by the TinySkies playground port — a material-heavy procedural globe game that exposed startup stalls, in-flight jank, and an import-time hang. None are game-specific; they benefit any large OSS scene.
@importscripts in OSS unconditionally. REACT_APP_SCRIPTS_ENABLED is unset everywhere, so every behavior that@imports a helper failed to import. Scripts are a first-class OSS authoring feature; integrated keeps the env opt-in.useShadowsthe source of truth and seed the renderer's shadow tracking from it. A no-shadow scene was paying shadow-variant shader compiles + a full-scene shadow pass every frame, and the first post-(re)create frame spuriously marked every material needsUpdate. Adaptive quality may still downgrade shadows but never force them on./api/Scene/EditPOST behind !IS_OSS; OSS has no such endpoint, so it 404-spammed on every import.Adds the port planning doc under docs/planning/.